﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="specialday.aspx.cs" Inherits="specialday" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    public void click(Object seder, EventArgs e)
    {

        SqlDataSource1.Update();
        Label1.Text = "*The prices of the date " + DropDownList1.SelectedItem.Text + " are changed to " + DropDownList2.SelectedItem.Text + " prices";
    }

</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
 <script type="text/javascript">
        
        function displayCalendar()
        {
            var datePicker = document.getElementById('datePicker');
            datePicker.style.display = 'block';
        }
    
    </script>
<%--This below code from the website:http://ramanisandeep.wordpress.com/2008/11/07/hide-an-aspnet-label-control-after-a-few-seconds/--%>

<script type="text/javascript">
    self.setInterval("changeValue1()", 4800);

    function changeValue1() {
        document.getElementById("Label1").innerText = "";

    }
 
</script>
 <style type="text/css">
        #datePicker
        {
            display:none;
            position:absolute;
            border:solid 2px black;
            background-color:white;
           
        }
    
    </style>
<style type="text/css">
.center1
{
    padding-left:320px;
}
html
{
  background-image:url('image/back.jpg');

    padding:10px;
    color:White;    
  
}
.content
{
    width:1000px;
    margin:auto;
        height: 197px;
    }
a
{
 color: white;
 text-decoration:none;

}
a:hover
{
 color: red; 
  text-decoration:none;

}
.link
{
  margin-left:350px; 
     font-weight:bold;
  font-size:large;  
    font-size:x-large;
}
.link2
{
  margin-left:50px; 
     font-weight:bold;
  font-size:large;  
    font-size:x-large;
}
.join
{
   background-color:#0099FF;
  clip:auto;
  font-weight:bold;
  font-size:large;
}
.table2
{
 border-style:solid;
   border-color:Black;
   background-color:White;
   color:Black;  
   width:900px; 
}
.row
{
   background-color:Gray;
   color:White;
}
.ticket
{
   background-color:#CC0000;
color:White;

}

.ticket:hover
{
 color: black; 
  text-decoration:none;


}
    .style1
    {
        width: 509px;
    }
    
.footer
{

     font-weight:bold;
  font-size:large;  

}
.footer
{
  
 margin-top:250px;
}
.content1
{
    padding-left:0px;
}
.center
{
    padding-left:410px;
}
.cinema
{
    padding-left:500px;
}
     .menu
{
 padding-left:150px;  

}
</style>
    <title>Special ticket pricing days</title>
</head>
<body>
    <form id="form1" runat="server">
    <div class="content">
   <asp:Image ID="Image1" Width="1000" Height="130" ImageUrl="~/image/tdk-jun5-bannerbatmanexclusivo2.jpg" runat="server" /><br />

 

<asp:HyperLink ID="HyperLink14"  CssClass="link" NavigateUrl="~/Default.aspx" runat="server">Home</asp:HyperLink>
<asp:HyperLink ID="HyperLink1"  CssClass="link2" NavigateUrl="~/Session.aspx" runat="server">Session</asp:HyperLink> <asp:HyperLink ID="HyperLink2" CssClass="link2" NavigateUrl="~/Movie.aspx" runat="server">Movies</asp:HyperLink>
<asp:HyperLink ID="HyperLink3" CssClass="link2"  NavigateUrl="~/Price.aspx" runat="server">Prices</asp:HyperLink>

 <br /> <br />
  <%-- <asp:Label ID="Label5" runat="server"  Text="Theatre" CssClass="cinema" Font-Bold="True" Font-Underline="True"></asp:Label>
        <asp:Label ID="Label4" runat="server"  ForeColor="Yellow"></asp:Label>
      
&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp&nbsp;&nbsp&nbsp&nbsp;&nbsp &nbsp&nbsp;&nbsp 
          <asp:Label ID="Label6" runat="server" Text="UserName" Font-Bold="True"></asp:Label>    <asp:LoginName ID="LoginName1" runat="server" /> 
    &nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp&nbsp;&nbsp&nbsp&nbsp;&nbsp<asp:LoginStatus ID="LoginStatus1" runat="server" ForeColor="#99CCFF" />--%>
<table class="center1" >
        <tr>
            <td>
               <asp:Label ID="Label22222" runat="server" CssClass="menu"  Text="Theatre" Font-Bold="True" Font-Underline="True" />
            </td>
            <td>
                 <asp:Label ID="Label4" runat="server"  ForeColor="Yellow"></asp:Label>
                 &nbsp;&nbsp;&nbsp;
            </td>
       <%-- </tr>
 </table> --%>
    <%--<td>&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp&nbsp;&nbsp&nbsp&nbsp;&nbsp &nbsp&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp&nbsp;&nbsp&nbsp&nbsp;&nbsp &nbsp&nbsp;&nbsp</td>--%>
<%--&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp&nbsp;&nbsp&nbsp&nbsp;&nbsp &nbsp&nbsp;&nbsp --%>
  <%--<table align="center" >
        <tr>--%>
            <td>
                <asp:Label ID="Label12" runat="server" Text="UserName" Font-Bold="True"></asp:Label>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td>
                <asp:LoginName ID="LoginName1" runat="server" /> 
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td>
                 <asp:LoginStatus ID="LoginStatus1" runat="server" ForeColor="#99CCFF" />
                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
        </tr>
    </table>
        <hr />
  <asp:Label ID="Label8" runat="server" Text="Maintain:" Font-Bold="True" Font-Size="Larger" Font-Underline="True"></asp:Label>
<asp:HyperLink ID="HyperLink17" runat="server" 
            NavigateUrl="~/TheatreStaff/Cinema.aspx" ForeColor="#FFCC99">[Cinemas]</asp:HyperLink>&nbsp;
    <asp:HyperLink ID="HyperLink18" runat="server"  ForeColor="#FFFF99" NavigateUrl="~/TheatreStaff/Movies.aspx">[Movies]</asp:HyperLink> &nbsp;
    <asp:HyperLink ID="HyperLink144" runat="server" NavigateUrl="~/TheatreStaff/Schedule.aspx" ForeColor="#FF9900">[Schedules]</asp:HyperLink>&nbsp;  
 <asp:HyperLink ID="HyperLink117" runat="server" NavigateUrl="~/TheatreStaff/Session.aspx" ForeColor="#FF6699">[Session Times]</asp:HyperLink>&nbsp;  
  <asp:HyperLink ID="HyperLink116" runat="server" NavigateUrl="~/TheatreStaff/SessionDates.aspx" ForeColor="#66FF66">[Session Date]</asp:HyperLink>&nbsp;   
 <asp:HyperLink ID="HyperLink115" runat="server" NavigateUrl="~/TheatreStaff/SpecialTickets.aspx" ForeColor="Aqua">[Specail Price]</asp:HyperLink>&nbsp;
 <asp:HyperLink ID="HyperLink107" runat="server" NavigateUrl="~/TheatreStaff/specialday.aspx" ForeColor="#CCFF33">[Special Ticket Pricing Days]</asp:HyperLink>&nbsp;  
     <asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl="~/TheatreStaff/SalesReports.aspx" ForeColor="#CCFFFF">[Sales Report]</asp:HyperLink>&nbsp; 
             <asp:HyperLink ID="HyperLink11" runat="server" NavigateUrl="~/TheatreStaff/AddNewUser.aspx" ForeColor="#66FF99">[Add New User]</asp:HyperLink>&nbsp; 
  <hr />

      <h3><asp:Label ID="Label9" Text ="Special Ticket Days Maintenance" runat="server" CssClass="center1" ForeColor="#CCFF33" /></h3>       
  <asp:BulletedList ID="BulletedList2"  CssClass="view2" ForeColor="#CCFF33" runat="server">
               <asp:ListItem  Text="Select a session date from 'DATE' and required ticket type from 'Ticket type' to update the special dates" />
               
       
        </asp:BulletedList>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
<%--<div class="content1" >--%>
    <fieldset >
  <asp:Label ID="Label7" runat="server" Visible="false" Text="Theatre: "></asp:Label><asp:Label ID="lblId" runat="server" Visible="false" ></asp:Label><br />
  <%-- <asp:Label ID="Label1" runat="server" Text="Please select a date for special ticket pricing days:" Font-Bold="True"></asp:Label><br />--%>
      <br />
       <asp:Label ID="Label1" runat="server" ForeColor="#FFFFCC" Font-Size="Large"></asp:Label><br />
        <asp:Label ID="Label2"  runat="server" Text="DATE:"></asp:Label> <asp:DropDownList ID="DropDownList1"  AppendDataBoundItems="true"  DataTextField="date" DataTextFormatString="{0:d}"  DataSourceID="SqlDataSource1" runat="server">
    <asp:ListItem Text="Select a date" Value="" /> 
    </asp:DropDownList>
       
   <asp:RequiredFieldValidator ID="DATE"  ControlToValidate="DropDownList1" runat="server"  Text="(Required)"  ErrorMessage="RequiredFieldValidator">
   <br /><br /> 
   </asp:RequiredFieldValidator>    <asp:Label ID="Label3" runat="server" Text="Ticket Type:"></asp:Label> 
        <asp:DropDownList ID="DropDownList2" runat="server">
          <asp:ListItem Text="Special" Value="Special" />
        <asp:ListItem Text="Normal" Value="Normal" />
        </asp:DropDownList>



        <asp:Button ID="Button1" runat="server" OnClick="click" Text="Update" /><br />
        </fieldset>
      <%-- </div>--%>
       </ContentTemplate>
        </asp:UpdatePanel>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            SelectCommand="SELECT DISTINCT datesession.date FROM session2 INNER JOIN datesession ON session2.sessionid = datesession.sessionid INNER JOIN Cinema ON session2.cinema = Cinema.CinemaId where cinema.theatreid=@theatreid"
 
                     UpdateCommand="UPDATE datesession SET sessiontype = @sessiontype FROM datesession INNER JOIN session2 ON datesession.sessionid = session2.sessionid INNER JOIN Cinema ON session2.cinema = Cinema.CinemaId WHERE (datesession.date = @date AND cinema.theatreid=@theatreid)">
<SelectParameters>

<asp:ControlParameter ControlID="lblid" Name="theatreid" />

</SelectParameters>
    <UpdateParameters>
<asp:ControlParameter ControlID="lblid" Name="theatreid" />
                      <asp:ControlParameter ControlID="DropDownList2" DbType="String" PropertyName="SelectedValue" Name="sessiontype" />
           
            <asp:ControlParameter ControlID="DropDownList1" DbType="Date" PropertyName="SelectedValue" Name="date" />

            </UpdateParameters>
 </asp:SqlDataSource>

   <asp:SqlDataSource ID="srcCinema" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
       SelectCommand ="SELECT Cinema.CinemaId,Cinema.CinemaClassType, Cinema.CinemaSeatingCapacity FROM Cinema INNER JOIN TheatreStaff ON Cinema.TheatreId = TheatreStaff.TheatreId WHERE (TheatreStaff.TheatreStaffUserName = @username)" >
        <SelectParameters>
                  <asp:Parameter Name ="username" Type ="string"/> 
            </SelectParameters>  
            </asp:SqlDataSource>   

 
 
 <br /><br /><br /><br /> <br /><br /> <br /><br /><br /><br /> <br /><br />
                 
<table align="left"  cellpadding="15" ><tr><td>Copyright@2012 MovieTix</td><td><asp:HyperLink ID="HyperLink8"  CssClass="footer" NavigateUrl="~/Default.aspx" runat="server">Homepage</asp:HyperLink></td><td><asp:HyperLink ID="HyperLink9"  CssClass="footer" NavigateUrl="~/TheatreStaff/Session.aspx" runat="server">Session</asp:HyperLink></td><td><asp:HyperLink ID="HyperLink10"  CssClass="footer" NavigateUrl="~/TheatreStaff/Movies.aspx" runat="server">Movies</asp:HyperLink></td><td><asp:HyperLink ID="HyperLink12"  CssClass="footer" NavigateUrl="~/register.aspx" runat="server">Register</asp:HyperLink></td><td><asp:HyperLink ID="HyperLink13"  CssClass="footer" NavigateUrl="~/Login.aspx" runat="server">Log In</asp:HyperLink></td></tr></table>
    </form>

</body>

</html>

